﻿{extends file="../home.html"}

{block name="title"}{$head_title}{/block}
	
{block name="css"}
{/block}

{block name="content"}
<!--s主内容-->
<section class="content-wrapper">
  <div class="content-container container">
  	<!-- s面包屑导航 -->
  	{include file="../breadcrum_nav.html"}
  	<!-- e面包屑导航 -->
    <!-- s分类 -->
    <div class="col-left">
    {include file="../common_personal_nav.html"}
	</div>	
    <!-- e分类 -->
    <!-- s主内容 -->
    <div class="col-main">
		{include file="../common_personal_header.html"}
		<div class="user-main">
			<!-- s需求反馈 -->
			<form action="{$requirment_submit_link}" enctype="multipart/form-data" method="post" >
			<table class="table table-bordered">
				<thead>
					<tr>
						<th>需求反馈</th>
					</tr>
				</thead>
		        <tbody>
		          <tr>
		            <td>希望解决时间</td>
		            <td>
		            	<input type="text" class="Wdate input-xlarge" id="require_time" name="require_time" value=""  onclick="WdatePicker({ dateFmt:'yyyy-MM-dd'})">
		            </td>
		          </tr>
		          <tr>
		            <td><span class="form-must">*</span>问题描述</td>
		            <td><textarea name="requirement" id="requirement" cols="30" rows="4"></textarea></td>
		          </tr>
		          <tr>
		            <td>附件上传</td>
		            <td>
		            	<div>
							<a href="javascript:;" class="add btn" title="上传附件" id="J_Uploader">上传附件</a>
							<span>仅支持2M以内doc,xls,zip,jpg,png格式文件</span>
						</div>
						<div class="preview" style="display:none;">
							<span id="J_Preview" class="pic-preview"></span>
						</div>
						<input type="hidden" name="attachment" id="attachment" />
					</td>
		          </tr>
		        </tbody>
		      </table>
		      <a class="btn btn-primary" href="javascript:;" onClick="requirement_submit();">需求提交</a>
		  	</form>
		      <!-- e需求反馈 -->
		</div>
	</div>
	<div class="clearfix"></div>
    <!-- e主内容 -->
  </div>
</section>
<!--e主内容-->
{/block}

{block name="js"}
<script src="/Public/Plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__JS__/jquery/ajaxupload.3.5.js?version={$version}"></script>
<script src="__JS__/front/bbc.districtdata.js?version={$version}"></script>
<script type="text/javascript">
{literal}
// ajax上传附件
new AjaxUpload("#J_Uploader", {
	action: "/Front/uploadHandler",
	name: "upfile",
	responseType: "json",
	onSubmit: function(){
		//alert('正在上传');
		//preview处的附件改为loading附件
		$('.preview').show();
	},
	onChange: function(file, extension){
		if (extension && /^(jpg|png|jpeg|gif|zip|doc|xls|pdf)$/.test(extension)) {
			return true;
		}
		else {
			alert('暂不支持该附件格式！');
			return false;
		}
	},
	onComplete: function(file, response){
	//	console.log(response);
		if (response.status === 0) {
			alert(response.msg);
		}
		else if (response.status === 1) {
			$('#J_Preview').text("附件上传成功");
			$('.preview').show();
			$('#attachment').val(response.img_url);
		}
	}
});
{/literal}
</script>

{/block}
